package com.cyy.aop;

import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/**
 * @author CYY
 * @since 2022/5/17
 */
@Component
@Aspect
public class MyAdvice {
    //定义切入点
    @Pointcut("execution(void com.cyy.dao.BookDao.update())")
    private void pt(){}

    //绑定切入点与通知关系，并指定通知添加到原始连接的具体执行位置
    @Before("pt()")
    public void method(){
        System.out.println(System.currentTimeMillis());
    }
}
